﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace SoftwareApproach.TestingExtensions.Tests
{
    [TestClass]
    public class StringExtensionsTests
    {
        public TestContext TestContext { get; set; }

        [TestMethod]
        public void String_ShouldEqualIgnoringCasePassTest()
        {
            "test".ShouldEqualIgnoringCase("TeSt");
            "test".ShouldEqualIgnoringCase("test");
        }

        [TestMethod]
        [ExpectedException(typeof(AssertFailedException))]
        public void String_ShouldEqualIgnoringCaseFailTest()
        {
            "test".ShouldEqualIgnoringCase("test1");
        }

        [TestMethod]
        public void String_ShouldNotEqualIgnoringCasePassTest()
        {
            "test".ShouldNotEqualIgnoringCase("Test1");
            "".ShouldNotEqualIgnoringCase("test");
        }

        [TestMethod]
        [ExpectedException(typeof(AssertFailedException))]
        public void String_ShouldNotEqualIgnoringCaseFailTest()
        {
            "test".ShouldNotEqualIgnoringCase("Test");
        }

        [TestMethod]
        public void String_ShouldBeEmptyPassTest()
        {
            "".ShouldBeEmpty();
            String.Empty.ShouldBeEmpty();
        }

        [TestMethod]
        [ExpectedException(typeof(AssertFailedException))]
        public void String_ShouldBeEmptyFailTest()
        {
            "test".ShouldBeEmpty();
        }


        [TestMethod]
        public void String_ShouldNotBeEmptyPassTest()
        {
            "test".ShouldNotBeEmpty();
            ((string)null).ShouldNotBeEmpty();
        }

        [TestMethod]
        [ExpectedException(typeof(AssertFailedException))]
        public void String_ShouldNotBeEmptyFailTest()
        {
            "".ShouldNotBeEmpty();   
        }
    }
}
